@extends('layout/index')

@section('main')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span>编辑商品</span>
        </div>
        <div class="mws-panel-body no-padding">
            <form class="mws-form" action="/Admin/goods/update" method="post" enctype="multipart/form-data">
                <input type="hidden" name="id" value="{{$row->id}}">
                <div class="mws-form-inline">
                    <div class="mws-form-row">
                        <label class="mws-form-label">商品名称</label>
                        <div class="mws-form-item">
                            <input class="small" type="text" name="goodsname" value="{{$row->goodsname}}">
                        </div>
                    </div>

                    {{--<div class="mws-form-row">--}}
                        {{--<label class="mws-form-label">商品分类</label>--}}
                        {{--<div class="mws-form-item">--}}
                            {{--<select class="small" name="tid">--}}
                                {{--@foreach($tid as $v)--}}
                                    {{--<option>{{$v}}</option>--}}
                                {{--@endforeach--}}
                            {{--</select>--}}
                        {{--</div>--}}
                    {{--</div>--}}

                    <div class="mws-form-row bordered">
                        <label class="mws-form-label">商品图片</label>
                        <div class="mws-form-item">
                            @if($row->goodspic)
                                <img id="img0" src="{{$row->goodspic}}" alt="" width="100" height="100" onclick='$("#file0").click()'>
                            @else
                                <img id="img0" src="/upload/1.jpg" alt="" width="100" height="100" onclick='$("#file0").click()'>
                            @endif
                            <div  style="display:none" >
                                <input type="file" name="goodspic" id="file0" multiple="multiple" />
                            </div>
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">商品价格</label>
                        <div class="mws-form-item">
                            <input class="small" type="text" name="goodsprice" value="{{$row->goodsprice}}">
                        </div>
                    </div>

                    <div class="mws-form-row">
                        <label class="mws-form-label">库存</label>
                        <div class="mws-form-item">
                            <input class="small" type="text" name="goodsnum" value="{{$row->goodsnum}}">
                        </div>
                    </div>



                    <div class="mws-form-row">
                        <label class="mws-form-label">商品描述</label>
                        <div class="mws-form-item">
                            <textarea rows="" cols="" class="small" name="goodsdes">{{$row->goodsdes}}</textarea>
                        </div>
                    </div>

                </div>
                {{ csrf_field() }}
                <div class="mws-button-row">
                    <input value="修改" class="btn btn-danger" type="submit">
                    <input value="重置" class="btn " type="reset">
                </div>
            </form>
        </div>
    </div>

@stop
